/**
 *
 * @param {import('webpack').Compiler} compiler
 */
module.exports = function (compiler) {
  const name = '个人测试 TestCompilerPlugin';
  compiler.hooks.shouldEmit.tap(name, (compilation) => {
    console.log('========= shouldEmit');
  });
  compiler.hooks.emit.tapAsync(name, (compilation, callback) => {
    console.log('========= emit');
    callback();
  });
  compiler.hooks.assetEmitted.tapAsync(name, (file, info, callback) => {
    console.log('========= assetEmitted');
    callback();
  });
  compiler.hooks.afterEmit.tapAsync(name, (compilation, callback) => {
    console.log('========= afterEmit');
    callback();
  });
  compiler.hooks.done.tapAsync(name, (stats, callback) => {
    console.log('========= done');
    callback();
  });
};
